<!--
  订单表编辑页面
  User: YanZengBao
  Date: 2020-02-19
-->
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >

<!-- BEGIN FORM-->
<div class="portlet light">
    <div class="portlet-title">
        <div class="caption">
            <span class="caption-subject font-red-sunglo bold uppercase">订单表编辑</span>
            <span class="caption-helper">编辑一条订单表数据</span>
        </div>
    </div>
    <div class="portlet-body form">
        <!-- BEGIN FORM-->
        <form action="#" class="form-horizontal" id="edit-module">
            <div class="form-body">

                    <!--  字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label"></label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" disabled class="form-control" required name="id" th:value="${data['id']}" placeholder="">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 订单编号 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">订单编号</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="orderCode" th:value="${data['orderCode']}" placeholder="订单编号">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 停车场ID 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">停车场ID</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="parkId" th:value="${data['parkId']}" placeholder="停车场ID">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 停车场名称 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">停车场名称</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="parkName" th:value="${data['parkName']}" placeholder="停车场名称">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 车牌号码 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">车牌号码</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="plateNo" th:value="${data['plateNo']}" placeholder="车牌号码">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 进场记录ID 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">进场记录ID</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="enterRecordId" th:value="${data['enterRecordId']}" placeholder="进场记录ID">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 离场记录ID 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">离场记录ID</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="leaveRecordId" th:value="${data['leaveRecordId']}" placeholder="离场记录ID">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 停车时长 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">停车时长</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="number" class="form-control" required  name="stopTime" th:value="${data['stopTime']}" placeholder="停车时长">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 订单总价 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">订单总价</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="totalMoney" th:value="${data['totalMoney']}" placeholder="订单总价">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 实际金额 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">实际金额</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="reallyMoney" th:value="${data['reallyMoney']}" placeholder="实际金额">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 优惠简介 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">优惠简介</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="discountIntro" th:value="${data['discountIntro']}" placeholder="优惠简介">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 支付方式（0-未支付 1-支付宝 2-微信 3-余额 4-其他） 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">支付方式（0-未支付 1-支付宝 2-微信 3-余额 4-其他）</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="number" class="form-control" required  name="payType" th:value="${data['payType']}" placeholder="支付方式（0-未支付 1-支付宝 2-微信 3-余额 4-其他）">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 订单状态（0-未支付 1-已支付 2-已失效） 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">订单状态（0-未支付 1-已支付 2-已失效）</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="number" class="form-control" required  name="orderStatus" th:value="${data['orderStatus']}" placeholder="订单状态（0-未支付 1-已支付 2-已失效）">
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- 创建时间 字段信息-->
                        <div class="form-group">
                            <label class="col-md-3 control-label">创建时间</label>
                            <div class="col-md-4">
                                <div class="input-inline ">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="fa fa-edit"></i>
                                        </span>
                                        <input type="text" class="form-control" required minlength="2" name="createTime" th:value="${data['createTime']}" placeholder="创建时间">
                                    </div>
                                </div>
                            </div>
                        </div>

            </div>
            <div class="form-actions">
                <div class="row">
                    <div class="col-md-6">
                        <div class="row">
                            <div class="col-md-offset-3 col-md-9">
                                <button type="button" class="btn green" onclick="edit();">保存</button>
                                <button type="button" class="btn default" onclick="layer.close(layer_editModule);">取消</button>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6"> </div>
                </div>
            </div>
        </form>
        <!-- END FORM-->
    </div>
</div>

<script>

    $(function(){
        //初始化页面
        initPage();
    });

    function edit(){
        let param = tools.formParams("edit-module");
        if(tools.valid("edit-module")){
            tools.post("/order/update",param,function(data){
                if(data.success){
                    layer.msg('修改成功', {icon: 1,time:1000},function(){
                        //刷新列表页面
                        toPage(null);
                        //关闭弹窗
                        layer.close(layer_editModule);
                    });
                }else{
                    tools.errorTip(data);
                }
            });
        }
    }

</script>
</html>